<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>人员统计</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
</head>
<body>
<style>
    .tab-title{text-align:center;font-size: 18px;font-weight:bold;color:#333;margin-top:20px;}
    .tab-tit-span{text-align:center;font-size:14px;color:#666;margin-top: 0!important;}
    .tab-tit-span span{display:inline-block;margin:10px; font-weight: normal; }
    .tab-tit-span span .red{ margin:0 3px; font-weight: bold;}
</style>
<div class="wrap-container clearfix">
    <div class="tab-title"></div>
    <div class="tab-title tab-tit-span"></div>
    <div class="column-content-detail">
        <form class="layui-form" method="post">
        <div class="search-cont clearfix" id="tool">
            <div class="operation-btn-cont">
                <input type="hidden" name="applyId" value="${applyId}" />
                <input type="hidden" name="association" id="association"/>
                <div class="operright cyt-retract-close hideMenu"> 收起筛选<i class="iconfont">&#xe658;</i></div>
                <div class="operright cyt-retract-open showMenu" style="display: none;"> 展开筛选<i class="iconfont">&#xe936;</i></div>
                <button class="layui-btn layui-btn-normal layui-btn-mid" type="button" id="exportExcel"><i class="iconfont marr5">&#xe606;</i>导出人员</button>
                <button class="layui-btn layui-btn-normal layui-btn-mid" type="button" id="static"><i class="iconfont marr5">&#xe614;</i>社团统计</button>
                <div class="triangle-bottom"></div>
                <div class="triangle-top"></div>
            </div>
            <div class="search-details">
                <div class="layui-form-item marb5">
                    <!--search开始-->
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:80px!important;">姓名：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="userName" name="userName" placeholder="请输入姓名" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:80px!important;">学号：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="userNumber" name="userNumber" placeholder="请输入学号" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label" style="width:80px!important;">社团名称：</label>
                        <div class="layui-input-inline">
                            <input type="text" id="assTitle" name="assTitle" placeholder="请输入社团名称" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <!--search结束-->
                    <div class="layui-inline marl8">
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="seacherBtn">搜索</button>
                        <button class="layui-btn layui-btn-normal" type="reset">重置</button>
                    </div>
                </div>
            </div>
        </div>

        </form>

        <div class="layui-form" id="table-list">
            <table id="entityList" lay-filter="entityList" class="cy-list-table"></table>
        </div>

    </div>
</div>
<!--操作-->
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/html" id="ty"></script>
<script>
    var applyId='${applyId}';
    var id ='${id}';
    layui.use(['jquery', 'table', 'page', 'dialog', 'baseutil'], function () {
        var $ = layui.jquery,
            page = layui.page,
            layer = layui.layer,
            table = layui.table,
            baseutil = layui.baseutil;
           loadAssNew();

        //获取分页数据
        var url = "/work/wxassociationnewstu/wxassociationnewstu/findVoHasSignPage?associationNewId="+id;
        var cols = [
                {field: 'title', title: '序号', align: 'left',type:'numbers'},
                {field: 'assTitle', title: '社团名称', align: 'center'},
                {field: 'userName', title: '姓名', align: 'center'},
                {field: 'userNumber', title: '学号', align: 'center'},
                {field: 'gradeName', title: '年级', align: 'center'},
                {field: 'className', title: '班级', align: 'center'},
                {
                    field: 'signTime', title: '加入时间', align: 'center', templet: function (d) {
                    return new Date(d.signTime).Format("yyyy-MM-dd");
                },
                }
            ];
        page.initDate(cols, url);


        //监听行工具事件
        table.on('tool(entityList)', function (obj) {
            var layEvent = obj.event,
                data = obj.data;
            if (layEvent === 'show') {
                layer.photos({
                    photos: {
                        "title": '',
                        "id": baseutil.acceptRandom(1),
                        "start": 0,
                        "data": [{
                            "alt": "",
                            "pid": 1,
                            "src": data.headLogo,
                            "thumb": ""
                        }]
                    },
                    shift: 5
                });
            }
        });


        //人员统计
        $('#static').bind('click', function () {
            debugger;
            page.edit("associationStatic","/work/associationNew/wxassociationnew/getstatic?applyId="+applyId+'&id=' + id,"社团统计");
        });
        //导出社团
        $("#exportExcel").on("click",function () {
            window.location.href = "/work/associationNew/wxassociationnew/exportStu?id="+id;
        });

        //首次获取社团招新详情
        var newStatus = "";//判断这次招新状态
        function loadAssNew() {
            baseutil.get('/work/associationNew/wxassociationnew/associationNewStatis', {"id":id}, function (result) {
                if (result.code == 0) {
                    //招新内容
                    var data = result.data;
                    $(".tab-title").first().html(data.title);
                    var titleContent = "<span>招新日期：" + data.beginDate + "到" + data.endDate + "</span>";
                    titleContent += "<span>招新时间段：" + data.beginTime + "到" + data.endTime + "</span>";
                    var statusName = "发布中";
                    newStatus = data.status;
                    if (data.status == "2") {
                        statusName = "已结束";
                    }

                    titleContent += "<span>招新状态：" + statusName + "</span>";
                    titleContent += "<span>共招新<span class='red'>" + data.totalNumber + "</span>人</span>";
                    titleContent += "<span>已招新<span class='red'>" + data.stuNumber + "</span>人</span>";
                    $(".tab-title:eq(1)").html(titleContent);

                } else {

                }
            });

        }




    });
</script>
</body>
</html>